From 56a7a7851b09cb30a5cd543c8cb4f926109b4290 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 24 May 2026 13:22:34 +0000 Subject: refactor(locale): move hardcoded UI strings into english locale Adds optional namespaces (common, errors, commandPalette, headTitle, notifications, schedule, events, home, reader, routes, badgePreview, badgeWall) and extends existing ones (settings.*, lists.*, tools.*, user.*, hololive.*) on the Locale interface. New fields are optional so japanese.ts can omit them; svelte-i18n's fallbackLocale handles the runtime miss. HeadTitle gains an optional routeKey prop for type-safe lookup. defaultActions becomes a factory so the command palette re-reads locale on language toggle. The existing JP feedback translation in routes/settings is preserved via japanese.ts. Out of scope (kept hardcoded): service-worker.ts, app.html, Landing*.svelte, tools.ts registry, Easter Event 2025 pages. --- src/routes/user/[user]/+page.svelte | 45 +++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'src/routes/user/[user]/+page.svelte') diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte index 1bcedc52..bfcdd87b 100644 --- a/src/routes/user/[user]/+page.svelte +++ b/src/routes/user/[user]/+page.svelte @@ -237,27 +237,29 @@ const toggleCategory = () => { // 8.5827814569536423841e0 - + {#if error} - @{data.username}'s - profile could not be loaded. + @{data.username}{$locale().errors?.profileCouldNotBeLoaded?.split('@{username}')[1]} {:else} {#if userData === null}

- Could not load user profile for @{data.username}. + >{$locale().user.profile.notLoaded?.split('@{username}')[1]}

{:else if userData === undefined} - + {:else}
{ {#if userData && authorisedUsers.includes(userData.id)} ‌ - + {/if} - Badge Wall + {$locale().user.profile.badgeWallLink}

{#if preferences && preferences.biography && preferences.biography.length > 0} @@ -362,7 +364,7 @@ const toggleCategory = () => { >
- +
@@ -401,7 +403,7 @@ const toggleCategory = () => { - Pinned Categories + {$locale().user.profile.pinnedCategories}
{#each ownerPreferences.pinned_badge_wall_categories as category} @@ -423,23 +425,28 @@ const toggleCategory = () => { {$locale().common?.remove}
{/each} - + - +
- Biography + {$locale().user.profile.biography} {$locale().common?.save} - Badge Wall Custom CSS + {$locale().user.profile.badgeWallCustomCss} {$locale().common?.save} {/if} -- cgit v1.2.3